import Vue from 'vue'
import VueRouter  from 'vue-router'
//import Home from '../views/Main.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        name : 'Main',
        component: () => import('../view/Main.vue'),
        children:[
            {
                path:'/home',
                name:'home',
                component:() => import('../view/home')
            },
            { 
                path:'/user',
                name:'user',
                component:() => import('../view/user')
            },
            { 
                path:'/mall',
                name:'mall',
                component:() => import('../view/mall/mall.vue')
            },
            { 
                path:'/page1',
                name:'page1',
                component:() => import('../view/other/page1.vue')
            },
            { 
                path:'/page2',
                name:'page2',
                component:() => import('../view/other/page2.vue')
            }
        ]
    },
    {
        path:'/login',
        name:'login',
        component:() => import('../view/login/login.vue')
    }
    
]

const router = new VueRouter({
    mode : 'history',
    routes
})

export default router